package pooller.model;


import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;

public class AutoClosableEnMan implements AutoCloseable {
    private EntityManager em;

    public AutoClosableEnMan(EntityManagerFactory emf) {
        this.em = emf.createEntityManager();
    }

    public EntityManager getEm() {
        return em;
    }

    @Override
    public void close() throws Exception {
        em.close();
    }
}
